package com.administrator.cloudapplication.activitys;

import android.content.Intent;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.administrator.cloudapplication.R;
import com.administrator.cloudapplication.base.BaseActivity;

/**
 * 登陆页面，简单的布局跟跳转。
 */
public class LoginActivity extends BaseActivity implements View.OnClickListener {
    Button btn_login;
    TextView tv_register;
    TextView tv_forget_psd;

    @Override
    protected void initView() {
        setContentView(R.layout.activity_login);
        btn_login = (Button) findViewById(R.id.btn_login);
        tv_register = (TextView) findViewById(R.id.tv_register);
        tv_forget_psd = (TextView) findViewById(R.id.tv_forget_psd);
        initTitleView();
        tvTitle.setText("登录");
    }

    @Override
    protected void initData() {
        btn_login.setOnClickListener(this);
        tv_register.setOnClickListener(this);
        tv_forget_psd.setOnClickListener(this);
    }

    @Override
    protected void onLeftClick() {
        finish();
    }

    @Override
    protected void onRightClick() {

    }


    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.btn_login:
                Intent intent = new Intent(LoginActivity.this, UserActivity.class);
                startActivity(intent);
                break;
            case R.id.tv_register:
                intent = new Intent(LoginActivity.this, RegisterActivity.class);
                startActivity(intent);
                break;
            case R.id.tv_forget_psd:
                intent = new Intent(LoginActivity.this, ForgetPsdActivity.class);
                startActivity(intent);
                break;
        }
    }
}
